using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;
using Ras2ClassLib.Common.Data;

namespace Ras2ClassLib
{
	public class VinListFaerslaDoc : BaseDocument
	{
			#region Public functions
		public VinListFaerslaDoc()
		{
		}

		public VinListFaerslaCollection GetAllVinListFaersla(int nID)
			{
				String strSQL = String.Format("SELECT * FROM ListaFaersla lf, Lag lg,  Flytjandi fl  WHERE  lf.ListaFaersluLag = lg.LagID AND lg.FlytjandiID = fl.FlytjandiID AND lf.ListaFaersluListi ={0}", nID);
				return base.LoadCollection<VinListFaerslaCollection, VinListFaersla>(strSQL);
			}

	
		public VinListFaersla GetVinListFaersla(int nID)
			{
				String strSQL = String.Format("SELECT * FROM ListaFaersla INNER JOIN Lag ON ListaFaersla.LagID = Lag.LagID INNER JOIN Flytjandi ON Lag.FlytjandiID = Flytjandi.FytjandiID WHERE ListaID = " + nID);			
				return base.LoadItem<VinListFaersla>(strSQL);
			}
			#endregion
		}
	}

